import { ApiProperty } from '@nestjs/swagger';
import { IsNumber } from 'class-validator';
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity()
export class History {
  @ApiProperty({ description: 'id' })
  @PrimaryGeneratedColumn('uuid')
  id: string; // 标记为主列，值自动生成

  @ApiProperty({ description: '时间' })
  @Column({
    comment: '时间',
    type: 'bigint',
  })
  @IsNumber()
  date: number;

  @ApiProperty({ description: '记录内容' })
  @Column({
    type: 'json',
    comment: '记录内容',
  })
  desc: string[];
}
